<template>
	<view>
		<view class="noticeListDetails ff-bg-fff ff-margin-10 ff-padding-13 ff-border-radius-5">
			<view class="ff-font-16 ff-font-weight-600 ff-color-333 ff-line-height-1-3">
				{{ noticeListDetails.noticeName }}
			</view>
			<view class="ff-font-12 ff-margin-top-10 ff-margin-bottom-10">{{ noticeListDetails.created }}</view>
			<textarea class="ff-line-height-1-3" maxlength="-1" disabled="true"
				v-model="noticeListDetails.noticeContent" auto-height></textarea>
		</view>
		<u-toast ref="uToast" />
		<f-loading ref="loading" />
	</view>
</template>

<script>
	export default {
		name: 'noticeListDetails',
		data() {
			return {
				noticeListDetails: {} // 公告详情页数据
			};
		},
		onLoad(e) {
			// console.log('前页面传过来的数据------', e);
			this.getNoticeDetails(e.id);
		},
		methods: {
			// 获取公告详情页
			async getNoticeDetails(id) {
				this.$refs.loading.openLoading('加载中···'); // 打开loading动画
				const data = await this.$http.get({
					url: `/sys/notice/info/${id}`
				});
				// console.log('公告详情数据----', data);
				if (data.code == 200) {
					this.noticeListDetails = data.data;
				} else {
					that.$refs.uToast.show({
						title: data.msg,
						type: 'error'
					});
				}
				this.$refs.loading.closeLoading(); // 关闭loading动画
			}
		}
	};
</script>

<style lang="scss" scoped>
	.noticeListDetails {
		.ff-font-12 {
			color: #a8a7b5;
		}

		.ff-font-14 {
			color: #5c5f65;
		}
	}
</style>